package com.etogc.groupchat.group.biz;

import android.app.Activity;

import com.etogc.http.VolleyHttpUtil;
import com.etogc.util.GcUrl;
import com.etogc.view.LoadDialog;

import java.util.HashMap;


/**
 * Created by ZeroVoid on 2018-3-12.
 */

public class GroupHttpBiz2 {

    public static void getGroupInfo(final Activity act, String groupID, VolleyHttpUtil.ResponseCallBack callback) {
        LoadDialog.show(act);
        VolleyHttpUtil.getInstance().getWithCallback(GcUrl.GROUP_INFO + groupID, callback);
    }

    public static void getMemberList(final Activity act, String groupID, VolleyHttpUtil.ResponseCallBack callback) {
        LoadDialog.show(act);
        HashMap<String, Object> map = new HashMap<>();
        map.put("group_id", groupID);
        VolleyHttpUtil.getInstance().postWithCallback(GcUrl.MEMBER_LIST, map, callback);
    }

    public static void getSearchList(final Activity act, String groupName, VolleyHttpUtil.ResponseCallBack callback) {
        LoadDialog.show(act);
        VolleyHttpUtil.getInstance().getWithCallback(GcUrl.SEARCH_LIST + groupName, callback);
    }

    public static void uploadHead() {

    }

    public static void getBannerList(final Activity act, VolleyHttpUtil.ResponseCallBack callback) {
        LoadDialog.show(act);
        VolleyHttpUtil.getInstance().getWithCallback(GcUrl.BANNER_LIST, callback);
    }

    public static void getAllGroup(final Activity act, int pageIndex, VolleyHttpUtil.ResponseCallBack callback) {
        LoadDialog.show(act);
        HashMap<String, Object> map = new HashMap<>();
        map.put("currentPage", pageIndex);
        VolleyHttpUtil.getInstance().postWithCallback(GcUrl.ALL_GROUP_LIST, map, callback);
    }
}
